home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / applic / ntp / doc / sntp.txt.Z / sntp.txt
Encoding:
Text File  |  1994-09-23  |  33.3 KB  |  756 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                         D.L. Mills
  8. Request for Comments: XXXX                        University of Delaware
  9. Obsoletes: RFC-1361                                       September 1994
  10.  
  11.  
  12.  
  13.                 Simple Network Time Protocol (SNTP)
  14.  
  15.  
  16.  
  17. Status of this Memorandum
  18.  
  19.    This memorandum describes the Simple Network Time Protocol (SNTP),
  20.    which is an adaptation of the Network Time Protocol (NTP) used to
  21.    synchronize computer clocks in the Internet. SNTP can be used when
  22.    the ultimate performance of the full NTP implementation described in
  23.    RFC-1305 is not needed or justified. It can operate in both unicast
  24.    modes (point to point) and broadcast modes (point to multipoint). It
  25.    can also operate in IP multicast mode where this service is
  26.    available. SNTP involves no change to the current or previous NTP
  27.    specification versions or known implementations, but rather a
  28.    clarification of certain design features of NTP which allow operation
  29.    in a simple, stateless remote-procedure call (RPC) mode with accuracy
  30.    and reliability expectations similar to the UDP/TIME protocol
  31.    described in RFC-868.
  32.  
  33.    This memorandum obsoletes RFC-1361 of the same title. Its purpose is
  34.    to explain the protocol model for operation in broadcast mode, to
  35.    provide additional clarification in some places and to correct a few
  36.    typographical errors. A working knowledge of the NTP Version 3
  37.    specification RFC-1305 is not required for an implementation of SNTP.
  38.    Distribution of this memorandum is unlimited.
  39.  
  40. 1. Introduction
  41.  
  42.    The Network Time Protocol (NTP) specified in RFC-1305 [MIL92] is used
  43.    to synchronize computer clocks in the global Internet. It provides
  44.    comprehensive mechanisms to access national time and frequency
  45.    dissemination services, organize the time-synchronization subnet and
  46.    adjust the local clock in each participating subnet peer. In most
  47.    places of the Internet of today, NTP provides accuracies of 1-50 ms,
  48.    depending on the characteristics of the synchronization source and
  49.    network paths.
  50.  
  51.    RFC-1305 specifies the NTP protocol machine in terms of events,
  52.    states, transition functions and actions and, in addition, optional
  53.    algorithms to improve the timekeeping quality and mitigate among
  54.    several, possibly faulty, synchronization sources. To achieve
  55.    accuracies in the low milliseconds over paths spanning major portions
  56.    of the Internet of today, these intricate algorithms, or their
  57.    functional equivalents, are necessary. However, in many cases
  58.    accuracies of this order are not required and something less, perhaps
  59.    in the order of large fractions of the second, is sufficient. In such
  60.    cases simpler protocols such as the Time Protocol [POS83], have been
  61.  
  62.  
  63. Mills                                                           [Page 1]
  64.  
  65.  
  66.  
  67.  
  68. RFC                                                       September 1994
  69.  
  70.    used for this purpose. These protocols usually involve an RPC
  71.    exchange where the client requests the time of day and the server
  72.    returns it in seconds past some known reference epoch.
  73.  
  74.    NTP is designed for use by clients and servers with a wide range of
  75.    capabilities and over a wide range of network delays and jitter
  76.    characteristics. Most users of the Internet NTP synchronization
  77.    subnet of today use a software package including the full suite of
  78.    NTP options and algorithms, which are relatively complex, real-time
  79.    applications. While the software has been ported to a wide variety of
  80.    hardware platforms ranging from supercomputers to personal computers,
  81.    its sheer size and complexity is not appropriate for many
  82.    applications. Accordingly, it is useful to explore alternative access
  83.    strategies using far simpler software appropriate for less stringent
  84.    accuracy expectations.
  85.  
  86.    This memorandum describes the Simple Network Time Protocol (SNTP),
  87.    which is a simplified access strategy for servers and clients using
  88.    NTP as now specified and deployed in the Internet. There are no
  89.    changes to the protocol or implementations now running or likely to
  90.    be implemented in the near future. The access paradigm is identical
  91.    to the UDP/TIME Protocol and, in fact, it should be easily possible
  92.    to adapt a UDP/TIME client implementation, say for a personal
  93.    computer, to operate using SNTP. Moreover, SNTP is also designed to
  94.    operate in a dedicated server configuration including an integrated
  95.    radio clock. With careful design and control of the various latencies
  96.    in the system, which is practical in a dedicated design, it is
  97.    possible to deliver time accurate to the order of microseconds.
  98.  
  99.    It is strongly recommended that SNTP be used only at the extremities
  100.    of the synchronization subnet. SNTP clients should operate only at
  101.    the leaves (highest stratum) of the subnet and in configurations
  102.    where no NTP or SNTP client is dependent on another SNTP client for
  103.    synchronization. SNTP servers should operate only at the root
  104.    (stratum 1) of the subnet and then only in configurations where no
  105.    other source of synchronization other than a reliable radio clock is
  106.    available. The full degree of reliability ordinarily expected of
  107.    primary servers is possible only using the redundant sources, diverse
  108.    subnet paths and crafted algorithms of a full NTP implementation.
  109.    This extends to the primary source of synchronization itself in the
  110.    form of multiple radio clocks and backup paths to other primary
  111.    servers should the radio clock fail or deliver incorrect time.
  112.    Therefore, the use of SNTP rather than NTP in primary servers should
  113.    be carefully considered.
  114.  
  115. 2. Operating Modes and Addressing
  116.  
  117.    Like NTP, SNTP can operate in either unicast (point to point) or
  118.    broadcast (point to multipoint) modes. A unicast client sends a
  119.    request to a server and expects a reply from which it can determine
  120.    the time and, optionally, the roundtrip delay and local clock offset
  121.    relative to the server. A broadcast server periodically sends a
  122.    message to a designated IP broadcast address or IP multicast group
  123.    address and ordinarily expects no requests from clients, while a
  124.  
  125.  
  126. Mills                                                           [Page 2]
  127.  
  128.  
  129.  
  130.  
  131. RFC                                                       September 1994
  132.  
  133.    broadcast client listens on this address and ordinarily sends no
  134.    requests to servers. Some broadcast servers may elect to respond to
  135.    client requests as well as send unsolicited broadcast messages, while
  136.    some broadcast clients may elect to send requests only in order to
  137.    determine the network propagation delay between the server and
  138.    client.
  139.  
  140.    In unicast mode the client and server IP addresses are assigned
  141.    following the usual conventions. In broadcast mode the server uses a
  142.    designated IP broadcast address or IP multicast group address,
  143.    together with a designated media-access broadcast address, and the
  144.    client listens on these addresses. For this purpose, an IP broadcast
  145.    address has scope limited to a single IP subnet, since routers do not
  146.    propagate IP broadcast datagrams. In the case of Ethernets, for
  147.    example, the Ethernet media-access broadcast address (all ones) is
  148.    used with an IP address consisting of the IP subnet number in the net
  149.    field and all ones in the host field.
  150.  
  151.    On the other hand, an IP multicast group address has scope extending
  152.    to potentially the entire Internet. The actual scope, group
  153.    membership and routing are determined by the Internet Group
  154.    Management Protocol (IGMP) [DEE89] and various routing protocols,
  155.    which are beyond the scope of this document. In the case of
  156.    Ethernets, for example, the Ethernet media-access broadcast address
  157.    (all ones) is used with the assigned IP multicast group address of
  158.    224.0.1.1. Other than the IP addressing conventions and IGMP, there
  159.    is no difference in server operations with either the IP broadcast
  160.    address or IP multicast group address.
  161.  
  162.    Broadcast clients listen on the designated media-access broadcast
  163.    address, such as all ones in the case of Ethernets. In the case of IP
  164.    broadcast addresses, no further provisions are necessary. In the case
  165.    of IP multicast group addresses, the host may need to implement IGMP
  166.    in order that the local router intercepts messages to the 224.0.1.1
  167.    multicast group. These considerations are beyond the scope of this
  168.    document.
  169.  
  170.    In the case of SNTP as specified herein, there is a very real
  171.    vulnerability that SNTP multicast clients can be disrupted by
  172.    misbehaving or hostile SNTP or NTP multicast servers elsewhere in the
  173.    Internet, since at present all such servers use the same IP multicast
  174.    group address 224.0.1.1. Where necessary, access control based on the
  175.    server source address can be used to select only those servers known
  176.    to and trusted by the client. Alternatively, by convention and
  177.    informal agreement, all NTP multicast servers now include an MD5-
  178.    encrypted message digest in every message, so that clients can
  179.    determine if the message is authentic and not modified in transit. It
  180.    is in principle possible that SNTP clients could implement the
  181.    necessary encryption and key-distribution schemes, but this is
  182.    considered not likely in the simple systems for which SNTP is
  183.    intended.
  184.  
  185.    While not integral to the SNTP specification, it is intended that IP
  186.    broadcast addresses will be used primarily in IP subnets and LAN
  187.  
  188.  
  189. Mills                                                           [Page 3]
  190.  
  191.  
  192.  
  193.  
  194. RFC                                                       September 1994
  195.  
  196.    segments including a fully functional NTP server with a number of
  197.    SNTP clients in the same subnet, while IP multicast group addresses
  198.    will be used only in special cases engineered for the purpose. In
  199.    particular, IP multicast group addresses should be used in SNTP
  200.    servers only if the server implements the NTP authentication scheme
  201.    described in RFC-1305, including support for the MD5 message-digest
  202.    algorithm.
  203.  
  204. 3. NTP Timestamp Format
  205.  
  206.    SNTP uses the standard NTP timestamp format described in RFC-1305 and
  207.    previous versions of that document. In conformance with standard
  208.    Internet practice, NTP data are specified as integer or fixed-point
  209.    quantities, with bits numbered in big-endian fashion from 0 starting
  210.    at the left, or high-order, position. Unless specified otherwise, all
  211.    quantities are unsigned and may occupy the full field width with an
  212.    implied 0 preceding bit 0.
  213.  
  214.    Since NTP timestamps are cherished data and, in fact, represent the
  215.    main product of the protocol, a special timestamp format has been
  216.    established. NTP timestamps are represented as a 64-bit unsigned
  217.    fixed-point number, in seconds relative to 0h on 1 January 1900. The
  218.    integer part is in the first 32 bits and the fraction part in the
  219.    last 32 bits. In the fraction part, the non-significant low-order
  220.    bits should be set to 0. This format allows convenient multiple-
  221.    precision arithmetic and conversion to UDP/TIME representation
  222.    (seconds), but does complicate the conversion to ICMP Timestamp
  223.    message representation (milliseconds). The precision of this
  224.    representation is about 200 picoseconds, which should be adequate for
  225.    even the most exotic requirements.
  226.  
  227.                            1                   2                   3
  228.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  229.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  230.       |                           Seconds                             |
  231.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  232.       |                  Seconds Fraction (0-padded)                  |
  233.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  234.  
  235.    Note that, since some time in 1968 the most significant bit (bit 0 of
  236.    the integer part) has been set and that the 64-bit field will
  237.    overflow some time in 2036. Should NTP or SNTP be in use in 2036,
  238.    some external means will be necessary to qualify time relative to
  239.    1900 and time relative to 2036 (and other multiples of 136 years).
  240.    Timestamped data requiring such qualification will be so precious
  241.    that appropriate means should be readily available. There will exist
  242.    a 200-picosecond interval, henceforth ignored, every 136 years when
  243.    the 64-bit field will be 0, which by convention is interpreted as an
  244.    invalid or unavailable timestamp.
  245.  
  246. 4. NTP Message Format
  247.  
  248.    Both NTP and SNTP are clients of the User Datagram Protocol (UDP)
  249.    [POS80], which itself is a client of the Internet Protocol (IP)
  250.  
  251.  
  252. Mills                                                           [Page 4]
  253.  
  254.  
  255.  
  256.  
  257. RFC                                                       September 1994
  258.  
  259.    [DAR81]. The structure of the IP and UDP headers is described in the
  260.    cited specification documents and will not be described further here.
  261.    The UDP port number assigned to NTP is 123, which should be used in
  262.    both the Source Port and Destination Port fields in the UDP header.
  263.    The remaining UDP header fields should be set as described in the
  264.    specification.
  265.  
  266.    Following is a description of the SNTP message format, which follows
  267.    the IP and UDP headers. The SNTP message format is identical to the
  268.    NTP format described in RFC-1305, with the exception that some of the
  269.    data fields are "canned," that is, initialized to pre-specified
  270.    values. The format of the NTP message is shown below.
  271.  
  272.                            1                   2                   3
  273.        0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  274.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  275.       |LI | VN  |Mode |    Stratum    |     Poll      |   Precision   |
  276.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  277.       |                          Root Delay                           |
  278.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  279.       |                       Root Dispersion                         |
  280.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  281.       |                    Reference Identifier                       |
  282.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  283.       |                                                               |
  284.       |                   Reference Timestamp (64)                    |
  285.       |                                                               |
  286.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  287.       |                                                               |
  288.       |                   Originate Timestamp (64)                    |
  289.       |                                                               |
  290.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  291.       |                                                               |
  292.       |                    Receive Timestamp (64)                     |
  293.       |                                                               |
  294.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  295.       |                                                               |
  296.       |                    Transmit Timestamp (64)                    |
  297.       |                                                               |
  298.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  299.       |                                                               |
  300.       |                                                               |
  301.       |                  Authenticator (optional) (96)                |
  302.       |                                                               |
  303.       |                                                               |
  304.       +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  305.  
  306.    As described in the next section, in SNTP most of these fields are
  307.    initialized with pre-specified data. For completeness, the function
  308.    of each field is briefly summarized below.
  309.  
  310.    Leap Indicator (LI): This is a two-bit code warning of an impending
  311.    leap second to be inserted/deleted in the last minute of the current
  312.    day, with bit 0 and bit 1, respectively, coded as follows:
  313.  
  314.  
  315. Mills                                                           [Page 5]
  316.  
  317.  
  318.  
  319.  
  320. RFC                                                       September 1994
  321.  
  322.       LI       Value     Meaning
  323.       -------------------------------------------------------
  324.       00       0         no warning
  325.       01       1         last minute has 61 seconds
  326.       10       2         last minute has 59 seconds)
  327.       11       3         alarm condition (clock not synchronized)
  328.  
  329.    Version Number (VN): This is a three-bit integer indicating the NTP
  330.    version number, currently 3.
  331.  
  332.    Mode: This is a three-bit integer indicating the mode, with values
  333.    defined as follows:
  334.  
  335.       Mode     Meaning
  336.       ------------------------------------
  337.       0        reserved
  338.       1        symmetric active
  339.       2        symmetric passive
  340.       3        client
  341.       4        server
  342.       5        broadcast
  343.       6        reserved for NTP control message
  344.       7        reserved for private use
  345.  
  346.    In unicast mode the client sets this field to 3 (client) in the
  347.    request and the server sets it to 4 (server) in the reply. In
  348.    broadcast mode the server sets this field to 5 (broadcast).
  349.  
  350.    Stratum: This is a eight-bit unsigned integer indicating the stratum
  351.    level of the local clock, with values defined as follows:
  352.  
  353.       Stratum  Meaning
  354.       ----------------------------------------------
  355.       0        unspecified or unavailable
  356.       1        primary reference (e.g., radio clock)
  357.       2-15     secondary reference (via NTP or SNTP)
  358.       16-255   reserved
  359.  
  360.    Poll Interval: This is an eight-bit signed integer indicating the
  361.    maximum interval between successive messages, in seconds to the
  362.    nearest power of two. The values that can appear in this field
  363.    presently range from 4 (16 s) to 14 (16284 s); however, most
  364.    applications use only the sub-range 6 (64 s) to 10 (1024 s).
  365.  
  366.    Precision: This is an eight-bit signed integer indicating the
  367.    precision of the local clock, in seconds to the nearest power of two.
  368.    The values that normally appear in this field range from -6 for
  369.    mains-frequency clocks to -20 for microsecond clocks found in some
  370.    workstations.
  371.  
  372.    Root Delay: This is a 32-bit signed fixed-point number indicating the
  373.    total roundtrip delay to the primary reference source, in seconds
  374.    with fraction point between bits 15 and 16. Note that this variable
  375.    can take on both positive and negative values, depending on the
  376.  
  377.  
  378. Mills                                                           [Page 6]
  379.  
  380.  
  381.  
  382.  
  383. RFC                                                       September 1994
  384.  
  385.    relative time and frequency offsets. The values that normally appear
  386.    in this field range from negative values of a few milliseconds to
  387.    positive values of several hundred milliseconds.
  388.  
  389.    Root Dispersion: This is a 32-bit unsigned fixed-point number
  390.    indicating the nominal error relative to the primary reference
  391.    source, in seconds with fraction point between bits 15 and 16. The
  392.    values that normally appear in this field range from 0 to several
  393.    hundred milliseconds.
  394.  
  395.    Reference Clock Identifier: This is a 32-bit code identifying the
  396.    particular reference source. In the case of stratum 0 (unspecified)
  397.    or stratum 1 (primary reference), this is a four-octet, left-
  398.    justified, 0-padded ASCII string. While not enumerated as part of the
  399.    NTP specification, the following are representative ASCII
  400.    identifiers:
  401.  
  402.       Stratum Code  Meaning
  403.       ----------------------------------------------------------------
  404.       1   pps       precision calibrated source, such as ATOM (atomic
  405.                     clock), PPS (precision pulse-per-second source),
  406.                     etc.
  407.       1   service   generic time service other than NTP, such as ACTS
  408.                     (Automated Computer Time Service), TIME (UDP/Time
  409.                     Protocol), TSP (Unix Time Service Protocol), DTSS
  410.                     (Digital Time Synchronization Service), etc.
  411.       1   radio     Generic radio service, with callsigns such as CHU,
  412.                     DCF77, MSF, TDF, WWV, WWVB, WWVH, etc.
  413.       1   nav       radionavigation system, such as OMEG (OMEGA), LORC
  414.                     (LORAN-C), etc.
  415.       1   satellite generic satellite service, such as GOES
  416.                     (Geostationary Orbit Environment Satellite, GPS
  417.                     (Global Positioning Service), etc.
  418.       2   address   secondary reference (four-octet Internet address of
  419.                     the NTP server)
  420.  
  421.    Reference Timestamp: This is the time at which the local clock was
  422.    last set or corrected, in 64-bit timestamp format.
  423.  
  424.    Originate Timestamp: This is the time at which the request departed
  425.    the client for the server, in 64-bit timestamp format.
  426.  
  427.    Receive Timestamp: This is the time at which the request arrived at
  428.    the server, in 64-bit timestamp format.
  429.  
  430.    Transmit Timestamp: This is the time at which the reply departed the
  431.    server for the client, in 64-bit timestamp format.
  432.  
  433.    Authenticator (optional): When the NTP authentication mechanism is
  434.    implemented, this contains the authenticator information defined in
  435.    Appendix C of RFC-1305. In SNTP this field is ignored for incoming
  436.    messages and is not generated for outgoing messages.
  437.  
  438. 5. SNTP Client Operations
  439.  
  440.  
  441. Mills                                                           [Page 7]
  442.  
  443.  
  444.  
  445.  
  446. RFC                                                       September 1994
  447.  
  448.    The model for n SNTP client operating with either a NTP or SNTP
  449.    server is a RPC client with no persistent state. In unicast mode, the
  450.    client sends a client request (mode 3) to the server and expects a
  451.    server reply (mode 4). In broadcast mode, the client sends no request
  452.    and waits for a broadcast message (mode 5) from one or more servers,
  453.    depending on configuration. Unicast client and broadcast server
  454.    messages are normally sent at periods from 64 s to 1024 s, depending
  455.    on the client and server configurations.
  456.  
  457.    A unicast client initializes the SNTP message header, sends the
  458.    message to the server and strips the time of day from the reply. For
  459.    this purpose all of the message-header fields shown above are set to
  460.    0, except the first octet. In this octet the LI field is set to 0 (no
  461.    warning) and the Mode field is set to 3 (client). The VN field must
  462.    agree with the software version of the NTP or SNTP server; however,
  463.    NTP Version 3 (RFC-1305) servers will also accept Version 2 (RFC-
  464.    1119) and Version 1 (RFC-1059) messages, while NTP Version 2 servers
  465.    will also accept NTP Version 1 messages. Version 0 (RFC-959) messages
  466.    are no longer supported. Since there are NTP servers of all three
  467.    versions interoperating in the Internet of today, it is recommended
  468.    that the VN field be set to 1.
  469.  
  470.    In both unicast and broadcast modes, the unicast server reply or
  471.    broadcast message includes all the fields described above; however,
  472.    in SNTP only the Transmit Timestamp has explicit meaning and then
  473.    only if nonzero. The integer part of this field contains the server
  474.    time of day in the same format as the UDP/TIME Protocol [POS83].
  475.    While the fraction part of this field will usually be valid, the
  476.    accuracy achieved with SNTP may justify its use only to a significant
  477.    fraction of a second. If the Transmit Timestamp field is 0, the
  478.    message should be disregarded.
  479.  
  480.    In broadcast mode, a client has no additional information to
  481.    calculate the propagation delay between the server and client, as the
  482.    Transmit Timestamp and Receive Timestamp fields have no meaning in
  483.    this mode. Even in unicast mode, most clients will probably elect to
  484.    ignore the Originate Timestamp and Receive Timestamp fields anyway.
  485.    However, in unicast mode a simple calculation can be used to provide
  486.    the roundtrip delay d and local clock offset t relative to the
  487.    server, generally to within a few tens of milliseconds. To do this,
  488.    the client sets the Originate Timestamp in the request to the time of
  489.    day according to its local clock converted to NTP timestamp format.
  490.    When the reply is received, the client determines a Destination
  491.    Timestamp as the time of arrival according to its local clock
  492.    converted to NTP timestamp format. The following table summarizes the
  493.    four timestamps.
  494.  
  495.       Timestamp Name          ID   When Generated
  496.       ------------------------------------------------------------
  497.       Originate Timestamp     T1   time request sent by client
  498.       Transmit Timestamp      T2   time request received at server
  499.       Receive Timestamp       T3   time reply sent by server
  500.       Destination Timestamp   T4   time reply received at client
  501.  
  502.  
  503.  
  504. Mills                                                           [Page 8]
  505.  
  506.  
  507.  
  508.  
  509. RFC                                                       September 1994
  510.  
  511.    The roundtrip delay d and local clock offset t are defined as
  512.  
  513.       Yd = (T4 - T1) - (T2 - T3)     t = ((T2 - T1) + (T3 - T4)) / 2.
  514.  
  515.    The following table is a summary of the SNTP client operations. There
  516.    are two recommended error checks shown in the table. In all NTP
  517.    versions, if the LI field is 3, or the Stratum field is not in the
  518.    range 1-15, or the Transmit Timestamp is 0, the server has never
  519.    synchronized or not synchronized to a valid timing source within the
  520.    last 24 hours. At the client discretion, the values of the remaining
  521.    fields can be checked as well. Whether to believe the transmit
  522.    timestamp or not in case one or more of these fields appears invalid
  523.    is at the discretion of the implementation.
  524.  
  525.       Field Name              Request        Reply
  526.       -------------------------------------------------------------
  527.       LI                      0              leap indicator; if 3
  528.                                              (unsynchronized), disregard
  529.                                              message
  530.       VN                      1 (see text)   ignore
  531.       Mode                    3 (client)     ignore
  532.       Stratum                 0              ignore
  533.       Poll                    0              ignore
  534.       Precision               0              ignore
  535.       Root Delay              0              ignore
  536.       Root Dispersion         0              ignore
  537.       Reference Identifier    0              ignore
  538.       Reference Timestamp     0              ignore
  539.       Originate Timestamp     0 (see text)   ignore (see text)
  540.       Receive Timestamp       0              ignore (see text)
  541.       Transmit Timestamp      0              time of day; if 0
  542.                                              (unsynchronized), disregard
  543.                                              message
  544.       Authenticator           (not used)     ignore
  545.  
  546. 6. SNTP Server Operations
  547.  
  548.    The model for a SNTP server operating with either a NTP or SNTP
  549.    client is an RPC server with no persistent state. Since a SNTP server
  550.    ordinarily does not implement the full set of NTP algorithms intended
  551.    to support redundant peers and diverse network paths, it is
  552.    recommended that a SNTP server be operated only in conjunction with a
  553.    source of external synchronization, such as a reliable radio clock.
  554.    In this case the server always operates at stratum 1.
  555.  
  556.    A server can operate in unicast mode, broadcast mode or both at the
  557.    same time. In unicast mode the server receives a request message,
  558.    modifies certain fields in the NTP or SNTP header, and returns the
  559.    message to the sender, possibly using the same message buffer as the
  560.    request. The server may or may not respond if not synchronized to a
  561.    correctly operating radio clock, but the preferred option is to
  562.    respond, since this allows reachability to be determined regardless
  563.    of synchronization state. In unicast mode, the VN and Poll fields of
  564.    the request are copied intact to the reply. If the Mode field of the
  565.  
  566.  
  567. Mills                                                           [Page 9]
  568.  
  569.  
  570.  
  571.  
  572. RFC                                                       September 1994
  573.  
  574.    request is 3 (client), it is set to 4 (server) in the reply;
  575.    otherwise, this field is set to 2 (symmetric passive) in order to
  576.    conform to the NTP specification.
  577.  
  578.    In broadcast mode, the server sends messages only if synchronized to
  579.    a correctly operating reference clock. In this mode, the VN field is
  580.    set to 3 (for the current SNTP version), and the Mode field to 5
  581.    (broadcast). The Poll field is set to the server poll interval, in
  582.    seconds to the nearest power of two. It is highly desirable that, if
  583.    a server supports broadcast mode, it also supports unicast mode. This
  584.    is necessary so a potential broadcast client can calculate the
  585.    propagation delay using client/server messages prior to regular
  586.    operation using only broadcast messages.
  587.  
  588.    The remaining fields are set in the same way in both unicast and
  589.    broadcast modes. Assuming the server is synchronized to a radio clock
  590.    or other primary reference source and operating correctly, the
  591.    Stratum field is set to 1 (primary server) and the LI field is set to
  592.    0; if not, the Stratum field is set to 0 and the LI field is set to
  593.    3. The Precision field is set to reflect the maximum reading error of
  594.    the local clock. For all practical cases it is computed as the
  595.    negative of the number of significant bits to the right of the
  596.    decimal point in the NTP timestamp format. The Root Delay and Root
  597.    Dispersion fields are set to 0 for a primary server; optionally, the
  598.    Root Dispersion field can be set to a value corresponding to the
  599.    maximum expected error of the radio clock itself. The Reference
  600.    Identifier is set to designate the primary reference source, as
  601.    indicated in the table above.
  602.  
  603.    The timestamp fields are set as follows. If the server is
  604.    unsynchronized or first coming up, all timestamp fields are set to
  605.    zero. If synchronized, the Reference Timestamp is set to the time the
  606.    last update was received from the radio clock or, if unavailable, to
  607.    the time of day when the message is sent. The Receive Timestamp and
  608.    Transmit Timestamp fields are set to the time of day when the message
  609.    is sent. In unicast mode, the Originate Timestamp field is copied
  610.    unchanged from the Transmit Timestamp field of the request. It is
  611.    important that this field be copied intact, as a NTP client uses it
  612.    to check for replays. In broadcast mode, this field is set to the
  613.    time of day when the message is sent. The following table summarizes
  614.    these actions.
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630. Mills                                                          [Page 10]
  631.  
  632.  
  633.  
  634.  
  635. RFC                                                       September 1994
  636.  
  637.       Field Name              Request        Reply
  638.       ----------------------------------------------------------
  639.       LI                      ignore         0 (normal), 3
  640.                                              (unsynchronized)
  641.       VN                      1, 2 or 3      3 or copied from request
  642.       Mode                    3 (see text)   2, 4 or 5 (see text)
  643.       Stratum                 ignore         1 server stratum
  644.       Poll                    ignore         copied from request
  645.       Precision               ignore         server precision
  646.       Root Delay              ignore         0
  647.       Root Dispersion         ignore         0 (see text)
  648.       Reference Identifier    ignore         source identifier
  649.       Reference Timestamp     ignore         0 or time of day
  650.       Originate Timestamp     ignore         0 or time of day or copied
  651.                                              from Transmit Timestamp of
  652.                                              request
  653.       Receive Timestamp       ignore         0 or time of day
  654.       Transmit Timestamp      (see text)     0 or time of day
  655.       Authenticator           ignore         (not used)
  656.  
  657.    There is some latitude on the part of most clients to forgive invalid
  658.    timestamps, such as might occur when first coming up or during
  659.    periods when the primary reference source is inoperative. The most
  660.    important indicator of an unhealthy server is the LI field, in which
  661.    a value of 3 indicates an unsynchronized condition. When this value
  662.    is displayed, clients should discard the server message, regardless
  663.    of the contents of other fields.
  664.  
  665. 7. References
  666.  
  667.    [DAR81] Defense Advanced Research Projects Agency. Internet Protocol.
  668.    DARPA Network Working Group Report RFC-791, USC Information Sciences
  669.    Institute, September 1981.
  670.  
  671.    [DEE89] Deering, S.E. Host extensions for IP multicasting. DARPA
  672.    Working Group Report RFC-1112, Stanford University, August 1989, 17
  673.    pp.
  674.  
  675.    [MIL92] Mills, D.L. Network Time Protocol (Version 3) specification,
  676.    implementation and analysis. DARPA Network Working Group Report RFC-
  677.    1305, University of Delaware, March 1992, 113 pp.
  678.  
  679.    [POS80] Postel, J. User Datagram Protocol. DARPA Network Working
  680.    Group Report RFC-768, USC Information Sciences Institute, August
  681.    1980.
  682.  
  683.    [POS83] Postel, J. Time protocol. DARPA Network Working Group Report
  684.    RFC-868, USC Information Sciences Institute, May 1983.
  685.  
  686. Security Considerations
  687.  
  688.    Security issues are not discussed in this memo.
  689.  
  690. Author's Address
  691.  
  692.  
  693. Mills                                                          [Page 11]
  694.  
  695.  
  696.  
  697.  
  698. RFC                                                       September 1994
  699.  
  700.    David L. Mills
  701.    Electrical Engineering Department
  702.    University of Delaware
  703.    Newark, DE 19716
  704.  
  705.    Phone: (302) 831-8247
  706.  
  707.    EMail: mills@udel.edu
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.  
  754.  
  755.  
  756. Mills                                                          [Page 12]